#include<bits/stdc++.h>
using namespace std;
vector<int> r;
vector<int> r2;
int n;
int main()
{
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	scanf("%d",&n);
	r.resize(n);
	for(int i=0;i<n;i++)
		scanf("%d",&r[i]);
	sort(r.begin(),r.end());
	r2.push_back(1);
	for(int i=1,tmp=r[0];i<n;i++)
	{
		if(r[i]==tmp)
			r2[r2.size()-1]++;
		else
		{
			tmp=r[i];
			r2.push_back(1);
		}
	}
	for(int i=0;i<r2.size()-1;i++)
	{
		if(r2[i]>=r2[i+1])
		{
			r2[i]-=r2[i+1];
		}
		else
		{
			int tmp=r2[i+1];
			for(int j=i;j>=0&&tmp>0;j--)
			{
				if(r2[j]<=tmp)
				{
					tmp-=r2[j];
					r2[j]=0;
				}
				else
				{
					r2[j]-=tmp;
					tmp=0;
				}
			}
		}
	}
	int ans=0;
	for(int i=0;i<r2.size();i++)
		ans+=r2[i];
	printf("%d",ans);
	return 0;
}